/**
 *
 */
package com.mmlc.network.filter;

import com.androidnetframe.BaseParentActivity;
import com.androidnetframe.httputil.BaseRequestFilterLayer;
import com.androidnetframe.httputil.EntryPageName;
import com.mmlc.meimei.lichengkongjian.been.RefundListBean;
import com.mmlc.network.requestbean.RefundListRequestBean;
import com.mmlc.network.responsebean.RefundListResponseBean;

import java.util.ArrayList;
import java.util.List;

/**
 * @author 何强
 *         2015-12-18
 * 退款列表
 */
public class RefundListRequestFilter extends BaseRequestFilterLayer {
    public RefundListRequestBean requestBean = new RefundListRequestBean();

    public RefundListRequestFilter(BaseParentActivity context) {
        super(context);
        makeRequestParams.entryPageName = EntryPageName.n5_a + "";
        makeRequestParams.setReqeustBean(requestBean, true);
    }


    public List<RefundListBean> uiBeanList;
    @Override
    public void getResultSuccess(String responseString, Object obj) {
        RefundListResponseBean resBean = (RefundListResponseBean) obj;
        uiBeanList = new ArrayList<>();
        for(int i=0;i<resBean.getData().size();i++){

            RefundListBean tmpUI = new RefundListBean();
            RefundListResponseBean.DataBean tmpRes = resBean.getData().get(i);

            tmpUI.orderId = tmpRes.getId();
            tmpUI.orderState = tmpRes.getRefund_msg();
            tmpUI.allShopPrice = tmpRes.getOrder_price();

            for(int j=0;j<tmpRes.getOrder_goods().size();j++){
                RefundListResponseBean.DataBean.OrderGoodsBean item = tmpRes.getOrder_goods().get(j);

                tmpUI.putItemBean(item.getImg_thumb_min(),item.getGoods_name(),item.getGoods_sn(),item.getPrice(),item.getNum());
            }

            uiBeanList.add(tmpUI);
        }
    }
}
